package com.isscollage.service.impl;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.isscollage.dao.LoginDao;
import com.isscollage.entity.Passenger;
import com.isscollage.entity.Users;
import com.isscollage.service.LoginService;
import com.isscollage.service.UserService;

@Service
public class LoginServiceImpl  implements LoginService {

	@Autowired
	private LoginDao loginDao;
	@Autowired
	private UserService userService;
	
	@Override
	public Users login(String userid, String password) {
		// TODO Auto-generated method stub
		return loginDao.login(userid, password);
	}
	
	@Override
	public Users loginTel(String userid,String tel){
		return loginDao.loginTel(userid,tel);
	}

	@Override
	public boolean register(Users user) {
		// TODO Auto-generated method stub
		user.setCreateTime(new Date());
		boolean flag=loginDao.insert(user);
		/*if(flag){
			Passenger passenger = new Passenger();
			passenger.setCreateId(user.getUserId());
			userService.insert(passenger);
		}*/
		return flag;
	}

}
